#include<stdio.h>
#include<string.h>
int WordCount(char *s)
{
    int len = strlen(s);
    int word = 1;
    for(int i = 0; i < len && s[i] != '\0'; i ++)
    {
        if(s[i] == ' ')
            word ++;
    }
    return word;
}
int main()
{
    char str[100];
    fgets(str, sizeof(str), stdin);
    int n = WordCount(str);
    printf("%d", n);
    return 0;
}
//方法2
int WordCount(char *s)
 {
     int word = 0, num = 0;
     while(*s != '\0'){
         if(*s == ' ')
         {
             word = 0;
         }
         if(word == 0)
         {
             num ++;
             word = 1;
         }
         s ++;
     }
     return num ;
 }